<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <link rel="stylesheet" href="styles/style.css">
        <link rel="stylesheet" href="styles/theme/atom-one-dark.css">
        <title>例子11-JS进阶（三）</title>
    </head>
    <body>
        <pre>
            <code>
                    // 例子11

                    var promise1 = Promise.resolve([1, 2, 3]);
                    var promise2 = Promise.resolve(new Promise(function(resolve, reject) {
                                resolve(2);
                    }).then(function(value) {
                            console.log(value);
                            return value;
                    }));
                    var promise3 = Promise.resolve(promise1);
                    console.log(promise1);
                    console.log(promise2);
                    console.log(promise3);
            </code>
        </pre>
        <script src="scripts/libs/highlight.pack.js"></script>
        <script src="scripts/11.js"></script>
        <script>
            hljs.initHighlightingOnLoad();
        </script>
    </body>
</html>